import service from "@/utils/request";
import { EartagAdd, startQuert } from "./model";
import { method } from "lodash";
import { url } from "inspector";

const DEP_BASE_URL = "/api/";

class eartag {
  static getList(queryParams?: startQuert) {
    return service<any, startQuert>({
      url: `${DEP_BASE_URL}EarTage/GetShow`,
      method: "get",
      params: queryParams,
    });
  }

  static GetShowbreed() {
    return service({
      url: `${DEP_BASE_URL}EarTage/ShowEarTageBreed`,
      method: "get",
    });
  }

  static deleteStart(id: number) {
    return service({
      url: `${DEP_BASE_URL}EarTage/Delete`,
      method: "delete",
      data: {
        id: id,
      },
    });
  }

  static DeleteRan(ids: any) {
    
    return service({
      url: `${DEP_BASE_URL}EarTage/DeleteRange`, // 使用一个专门的接口来支持批量删除
      method: "put",
      data: {
        ids: ids, // 将要删除的ID列表发送到后端
      },
    });
  }

  static Finds(id: number) {
    return service({
      url: `${DEP_BASE_URL}EarTage/GetFind`,
      method: "get",
      params: {
        id: id,
      },
    });
  }
  static Addinfo(eartagdata?: EartagAdd) {
    return service({
      url: `${DEP_BASE_URL}EarTage/Addeartage`,
      method: "post",
      data: eartagdata,
    });
  }

  static Updates(eartagdata?: EartagAdd) {
    return service({
      url: `${DEP_BASE_URL}EarTage/UpdateStart`,
      method: "post",
      data: eartagdata,
    });
  }
}

export default eartag;